package com.cookbook.cookbookservice.common.exception;

import lombok.Getter;

/**
 * @program: mid-tourism-service
 * @ClassName BusinessException
 * @description:
 * @author: MiaoChao
 * @create: 2024-02-28 23:08
 * @Version 1.0
 **/
@Getter
public class BizException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer code;


    public BizException(String message) {
        super(message);
    }

    public BizException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public BizException(BaseExceptionEnum baseExceptionEnum) {
        super(baseExceptionEnum.getMessage());
        this.code = baseExceptionEnum.getCode();
    }

    public BizException(String message, Throwable cause) {
        super(message, cause);
    }

    public BizException(Throwable cause) {
        super(cause);
    }

    public BizException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

}